<?php include '../public/header.php' ?>
<?php include '../public/header_index.php' ?>
<body class="laytp-container">
<div id="opt_nav">
</div>

<div class="layui-card" id="search-form">
    <div class="layui-card-body">
        <form class="layui-form" id="TableSearchFormId" lay-filter="TableSearchForm" onkeydown="keyTableSearch('TableSearchForm', 'datalist')">
            <div class="layui-form-item">
                <div class="layui-row">
                    <div class="layui-col-md3">
                        <label class="layui-form-label">编标人</label>
                        <div class="layui-input-block">
                            <input type="text" name="biaoren" placeholder="请输入" class="layui-input" autocomplete="off">
                        </div>
                    </div>
                    <div class="layui-col-md3">
                        <div class="layui-form-item search-div">
                            <div class="layui-form-item layui-inline">
                                <button class="laytp-btn laytp-btn-md laytp-btn-primary" id="TableSearchButton" type="button"><i class="layui-icon layui-icon-search"></i>查询</button>
                                <button class="layui-btn layui-btn-primary" onclick="listTableReset()" id="TableSearchReset" type="reset" ><i class="layui-icon layui-icon-refresh"></i>重置</button>
<!--                                <div id="search_open" onclick="toggle_search()">-->
<!--                                    <i class="layui-icon layui-icon-down"></i>展开-->
<!--                                </div>-->
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<div class="layui-card" id="table-card">
    <div class="layui-card-body">
        <div class="layui-row">
            <div class="layui-col-md12" id="table_list">
                <div class="layui-card-body">
                    <table id="datalist" lay-filter="datalist"></table>
                </div>
            </div>
        </div>
    </div>
</div>

<script type="text/html" id="test-dropdown-toolbar-barDemo">
    <div class="tab-list-authbut">
        <a href="javascript:;" class="bar_opt" onclick="auth_but_func_show('查看','{{d.LAY_TABLE_INDEX}}')">查看</a>
    </div>
</script>
<script type="text/html" id="toolbarDemo">
    <div class = "layui-btn-container">
    </div>
</script>
<script>

    layui.use(["laytp",'laypage','table','dropdown','form','soulTable'], function () {
        var laypage = layui.laypage, table = layui.table, dropdown = layui.dropdown, form = layui.form, soulTable = layui.soulTable;


        $('#TableSearchReset').click(function () {
            $('.xmselect_div>xm-select').find('.xm-label-block').css('display','none');
            $('.xmselect_div').append('<div class="xmselect_title">请选择</div>');
            searchTableFunc(form, table)
        });


        setSouTableExport('编标统计');
        var mytable = table.render({
            elem: "#datalist",id: "datalist"
            ,url: facade.url(ask_biao_lan_list),where: {}, page: true, height: 'full-140'
            ,soulSort: TabInit.soulSort,method: TabInit.method, toolbar: TabInit.toolbar, overflow: TabInit.overflow
            ,defaultToolbar: TabInit.defaultToolbar,filter: TabInit.filter
            ,request: TabInit.request,response: TabInit.response,contextmenu:get_table_contextmenu(soulTable)
            ,text: TabInit.text,totalRow: true
            ,parseData: function (res) {

                render_from();
                return {
                    "code": res.code,
                    "msg": res.message,
                    "count": res.data.total,
                    "data": res.data.data
                };
            }
            , cols: [[
                {type:'numbers',title:'序号',rowspan:2,totalRowText: '合计'}
                ,{field:'name',title:'编标人',rowspan:2,templet: function(d){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+'】\',\'bid_bian/index.php?bianer='+d.bianer+'\')">'+d.name+'</span>';
                    }}
                ,{field:'daiwan',title:'待完成项目数',rowspan:2,totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 待完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('待完成')+'\')">'+d.daiwan+'</span>';
                    }else{
                        return '<span>'+d.daiwan+'</span>';
                    }
                }}
                ,{field: '', title: '已完成项目数',align:'center',colspan:5,totalRow: true}
            ],
            [
                {field:'wan_ben',title:'本月完成',totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 本月完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('已完成')+'&seadt=ben\')">'+d.wan_ben+'</span>';
                    }else{
                        return '<span>'+d.wan_ben+'</span>';
                    }
                }}
                ,{field:'wan_shang',title:'上月完成',totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 上月完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('已完成')+'&seadt=shang\')">'+d.wan_shang+'</span>';
                    }else{
                        return '<span>'+d.wan_shang+'</span>';
                    }
                }}
                ,{field:'wan_san',title:'近三月完成',totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 近三月完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('已完成')+'&seadt=san\')">'+d.wan_san+'</span>';
                    }else{
                        return '<span>'+d.wan_san+'</span>';
                    }
                }}
                ,{field:'wan_jin',title:'今年完成',totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 今年完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('已完成')+'&seadt=jin\')">'+d.wan_jin+'</span>';
                    }else{
                        return '<span>'+d.wan_jin+'</span>';
                    }
                }}
                ,{field:'wan_zong',title:'总计完成',totalRow: true,templet: function(d){
                    if(d.bianer){
                        return '<span class="colorlan" onclick="openNavPage(\'编标管理【'+d.name+' - 总计完成】\',\'bid_bian/index.php?bianer='+d.bianer+'&iswan='+encodeURI('已完成')+'&seadt=zong\')">'+d.wan_zong+'</span>';
                    }else{
                        return '<span>'+d.wan_zong+'</span>';
                    }
                }}
            ]
            ]
            , done: function (res) {
                $("#layui-table-page1").remove();
                soulTable.render(this);
            }
        });
        listTableSearch(form, table);
    });



</script>
</body>
</html>
